import urllib.request
from bs4 import BeautifulSoup

url = "https://www.d1xz.net/astro/peidui/1-1.aspx"
response = urllib.request.urlopen(url)
print(type(response))  # 打印<class 'http.client.HTTPResponse'>
# 打印Http状态码
print(response.status) # 打印200
# 读取服务器返回的数据,对HTTPResponse类型数据进行读取操作
# the_page = response.read()
# 中文编码格式打印数据
# print(the_page.decode("utf-8"))

soup = BeautifulSoup(response.read().decode(), 'lxml')
print(soup)